home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HAM Radio 1997
/
HAM Radio 1997.iso
/
vcls
/
sprites
/
untdemo1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-04-08
|
1KB
|
51 lines
unit Untdemo1;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, MChSpBg, Mchsprt;
type
TForm1 = class(TForm)
MChSpriteBgr1: TMChSpriteBgr;
MChSprite1: TMChSprite;
MChSprite2: TMChSprite;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
function Sprite2PosFunc(AtTime: TDateTime):TPoint;
var
Form1: TForm1;
implementation
{$R *.DFM}
function Sprite2PosFunc(AtTime: TDateTime):TPoint;
var
x,y,alpha: double;
begin
alpha:=2*Pi*(AtTime-Form1.MChSprite2.SprTimeStarted)*24.0*60.0-100.0/180.0*Pi;
x := Form1.MChSpriteBgr1.ClientWidth /2.0 +
(Form1.MChSpriteBgr1.ClientWidth /3.0)*cos(alpha);
y := Form1.MChSpriteBgr1.ClientHeight /2.0 +
(Form1.MChSpriteBgr1.ClientWidth /3.0)*sin(alpha);
Sprite2PosFunc:=Point(round(x),round(y));
Form1.MChSprite2.SprSetScale(1+1.0*sin(alpha));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
MChSprite2.SprPosFunc:=Sprite2PosFunc;
MChSprite2.SprCruise(-1);
MChSprite1.SprShowOn;
end;
end.